<%@ page import="java.util.List" %>
<%@ page import="com.imau.bean.Book" %><%--
  Created by IntelliJ IDEA.
  User: yangzj321
  Date: 2024/10/20
  Time: 16:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
    <title>图书列表</title>
</head>
<body>
<h1>图书列表</h1>
<%
     List<Book> books=(List<Book>) request.getAttribute("bookList");

%>

<table width="90%" align="center" border="1">
    <tr>
        <td>编号</td>
        <td>书名</td>
        <td>类别</td>
        <td>描述</td>
        <td>操作</td>
    </tr>

    <c:forEach items="${applicationScope.bookList}" var="book"  >
            <tr>
                <td>${book.id}</td>
                <td>${book.name}</td>
                <td>${book.type}</td>
                <td>${book.description}</td>
                <td>操作</td>
            </tr>
    </c:forEach>


<%--    <%--%>

<%--        for (int i=0;i<books.size();++i)--%>
<%--        {--%>
<%--    %>--%>
<%--    <tr>--%>
<%--        <td><%=books.get(i).getId()%></td>--%>
<%--        <td><%=books.get(i).getName()%></td>--%>
<%--        <td><%=books.get(i).getType()%></td>--%>
<%--        <td><%=books.get(i).getDescription()%></td>--%>
<%--        <td>操作</td>--%>
<%--    </tr>--%>
<%--      <%}%>--%>

</table>
</body>
</html>
